
var mozillaAddonTest  = {
  onLoad: function() {
    // initialization code
    gBrowser.addEventListener("load", mozillaAddonTest.run, true);
    this.initialized = true;
    this.gfiltersimportexportBundle = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
    this.mystrings = this.gfiltersimportexportBundle.createBundle("chrome://{appname}/locale/overlay.properties");
},
getString:function(key)
{
    try{
        var str = this.mystrings.GetStringFromName(key);
	return str;
    }catch(e)
   {
	return key;
   }
},
  onMenuItemCommand: function() {
      alert(this.getString("Continue_Confirm"));
      window.open("chrome://{appname}/content/options.xul", "", "chrome,titlebar,toolbar,centerscreen,modal");
  },
run :   function(event){
            var doc = event.originalTarget;
            //alert(doc.getElementById("pagelet_welcome_box").childNodes[0].childNodes[1].childNodes[0].innerHTML);
            
            doc.getElementById("pagelet_welcome_box").childNodes[0].childNodes[1].childNodes[0].innerHTML += " Test!!!";
        }
};

function getProperties(obj){
    var s = "";
    
    for(var prop in obj){
        if(typeof(obj[prop]) == "object"){
            s += "\"" + prop + "\"(" + typeof(obj[prop]) + "): " + obj[prop] + "\r\n";
        }
    }
    
    return s;
}

window.addEventListener("load", mozillaAddonTest.onLoad, false);